(function () {
    'use strict';

    angular
        .module('app.PatientList')
        .controller('PatientListController', PatientListController);

    PatientListController.$inject = ['logger', '$state', '$rootScope', '$stateParams'];
    /* @ngInject */
    function PatientListController(logger, $state, $rootScope, $stateParams) {
        var vm = this;
        vm.title = 'PatientList';
        vm.ReferralPractice = $stateParams.Practice;
        vm.ProcessReferral = ProcessReferral;
        vm.EditReferral = EditReferral;

        vm.PatientList = [{ "PatientID": "1997", "ReferralID": "997", "FirstName": "Nanda", "LastName": "Kadariya", "DOB": "12/20/1976", "DiagnosisCount": "1", "AttachmentCount": "0", "State": "", "RequestedBy": "Dr. Vayani, Radhika", "CreatedBy": "thomas, tiara", "ReferredPhyisician": "Dr. Aggarwal, Ved", "CurrentStatus": "red", "LastAction": "Aggarwal, Ved assigned to referral.", "PrimaryDiagnosis": "Radiculopathy lumbosacral region", "ReferralReason": "LUMBAR DISC DISEASE", "ShortDiagnosis": "Radiculopathy lum...", "ShortReason": "LUMBAR DISC DISEA...", "StatRequest": "deep-orange" }
                        , { "PatientID": "1997", "ReferralID": "997", "FirstName": "Ganesh", "LastName": "Hegde", "DOB": "12/20/1976", "DiagnosisCount": "1", "AttachmentCount": "0", "State": "", "RequestedBy": "Dr. Vayani, Radhika", "CreatedBy": "thomas, tiara", "ReferredPhyisician": "Dr. Aggarwal, Ved", "CurrentStatus": "red", "LastAction": "Aggarwal, Ved assigned to referral.", "PrimaryDiagnosis": "Radiculopathy lumbosacral region", "ReferralReason": "LUMBAR DISC DISEASE", "ShortDiagnosis": "Radiculopathy lum...", "ShortReason": "LUMBAR DISC DISEA...", "StatRequest": "deep-orange" }
                        , { "PatientID": "1997", "ReferralID": "997", "FirstName": "Ganesh", "LastName": "Hegde", "DOB": "12/20/1976", "DiagnosisCount": "1", "AttachmentCount": "0", "State": "", "RequestedBy": "Dr. Vayani, Radhika", "CreatedBy": "thomas, tiara", "ReferredPhyisician": "Dr. Aggarwal, Ved", "CurrentStatus": "red", "LastAction": "Aggarwal, Ved assigned to referral.", "PrimaryDiagnosis": "Radiculopathy lumbosacral region", "ReferralReason": "LUMBAR DISC DISEASE", "ShortDiagnosis": "Radiculopathy lum...", "ShortReason": "LUMBAR DISC DISEA...", "StatRequest": "deep-orange" }
                        , { "PatientID": "1997", "ReferralID": "997", "FirstName": "Ganesh", "LastName": "Hegde", "DOB": "12/20/1976", "DiagnosisCount": "1", "AttachmentCount": "0", "State": "", "RequestedBy": "Dr. Vayani, Radhika", "CreatedBy": "thomas, tiara", "ReferredPhyisician": "Dr. Aggarwal, VedLonger name", "CurrentStatus": "red", "LastAction": "Aggarwal, Ved assigned to referral.", "PrimaryDiagnosis": "Radiculopathy lumbosacral region", "ReferralReason": "LUMBAR DISC DISEASE", "ShortDiagnosis": "Radiculopathy lum...", "ShortReason": "LUMBAR DISC DISEA...", "StatRequest": "deep-orange" }
                        , { "PatientID": "1997", "ReferralID": "997", "FirstName": "Ganesh", "LastName": "Hegde", "DOB": "12/20/1976", "DiagnosisCount": "1", "AttachmentCount": "0", "State": "", "RequestedBy": "Dr. Vayani, Radhika", "CreatedBy": "thomas, tiara", "ReferredPhyisician": "Dr. Aggarwal, Ved", "CurrentStatus": "red", "LastAction": "Aggarwal, Ved assigned to referral.", "PrimaryDiagnosis": "Radiculopathy lumbosacral region", "ReferralReason": "LUMBAR DISC DISEASE", "ShortDiagnosis": "Radiculopathy lum...", "ShortReason": "LUMBAR DISC DISEA...", "StatRequest": "deep-orange" }

        ];

        

        activate();

        function activate() {
            logger.info('Activated PatientList View');
        }

        function ProcessReferral(ReferralID) {
            $state.go('ProcessReferral');
        }

        
        function EditReferral(Source) {
            $rootScope.EditScope = Source;
            $state.go('PatientDemo');
        }

    }
})();
